<?php $list= $this->list; $data= $this->data; $data0= $this->data0; //Zend_Debug::dump($data);die; ?>

<style>
	#content .title-form{
		width:100%;
		font-size:1.4em;
		font-weight:bold;	
		margin:0px 0px 15px 0px;
}
	
	#content form{
		width:230%;
}
	#content form textarea{
		
}
	#content form .title-row{
		float:left;
		font-size:1em;
		width:25%;
}
    #l_info{
        float: left;
        border: 1px solid #DDD;
        border-radius: 4px 4px;
        width: 80px;
        height: 60px;
        padding: 0px 5px;
    }
    
    #r_info{
        float: right;
        border: 1px solid #DDD;
        border-radius: 4px 4px;
        width: 80px;
        height: 60px;
    }
    
    #score{
   	    font-size: 20px;
		font-weight:bold;
        padding: 4px 4px;
        
    }
    
   

</style>
<script type="text/javascript">

function showForm(){
	$(".ex_link").hide();
	$("#subject").show(); 
}

</script>		
	<div id="content">
 	 	<!--
          <div id="info">
            
            <div id="l_info">
                <div>
                    <center><?php if($data[0]['id']!='')  echo 'Đã Nộp '; else echo'Chưa Nộp'; ?></center>
                </div>
            </div>
            
            <div id="r_info">
                <div id="score">
                    Điểm:<br />
                    <center><?php  if($data0[0]['id']!='') echo $data0[0]['point']; else echo ''; ?></center>
                </div>
            </div>  
        <div class="cleaner"></div>
        </div>
        -->
     	<section class="grid_9" id="dashtabs" style="width:98%;min-height:400px;">	
			
            <div>
                <?php foreach($list as $value){?>
                        
                   <div class="components-news">
						<p class="title-news"><h2><center><?php echo $value["name"]; ?></center></h2></p> 
                        <p>Bắt đầu: <?php echo $value['time_start'];?> | Hạn nộp: <?php echo $value['time_end']; ?></p>
						
                        <div class="short-content-news" style=""> 
							<?php echo "<span style='font-weight:bold;'>Nội dung: </span>".strip_tags($value["content"]); ?>
							<div style="clear:both"></div>
							<?php 
			                  echo "<p style='width:30%;float:left;'><span style='font-weight:bold;'>File đính kèm: </span>";
			                  if($value["link"]) echo "<a href='".DOMAIN.$value["link"]."'>File đính kèm</a></p>";
			                  else echo "Không có! </p>";  
			              ?>
						</div>
					</div>      
                     
                <?php } ?>
             
            
            </div>
            
            <div id="contact_form">
				<?php
					if($this->success) echo "<p>Thêm thành công</p>";
					if($this->warning) echo "<p style='width:100%'>Có lỗi xảy ra! Dữ liệu nhập thiếu hoặc định dạng file không hợp lệ! Định dạng file chỉ có thể là .rar hoặc .zip</p>";
				?>
				<p class="title-form">Nộp bài tập</p>
               <form method="post" name="contact" action="" enctype="multipart/form-data">
                    <input type='text' name="id" value="<?php echo $data[0]['id']; ?>" style="display: none;" />
                    <label for="author" class="title-row">Tiêu đề:</label> <input type="text" id="author" name="title" value="<?php echo $data[0]['title']; ?>" class="required input_field" />
                    <div class="cleaner h10"></div>

                    <label for="subject" class="title-row">File đính kèm:</label> 
                        <?php if($data[0]['link']!=''){ ?>
                            <a class="ex_link" href="<?php echo DOMAIN.$data[0]['link']; ?>">File đính kèm</a> <button class="ex_link" onclick="showForm(); return false;" id="edit_link">Xóa</button>
                            <input style="display: none;"   type="file" name="file" id="subject" class="input_field" />
                        <?php }else{?>
                            <input type="file" name="file" id="subject" class="input_field" />
                        <?php } ?>
                    <div class="cleaner h10"></div>
                    
                    <label for="text" style="font-size:1em;margin-bottom:10px;">Nội dung:</label> <textarea  class="ckeditor" id="text" name="content" rows="0" cols="0"><?php echo $data[0]['content'] ?></textarea>
                    <div class="cleaner h10"></div>
 					
					<input style="background:#68AAEE;margin-left:30px;" type="submit" value="Send" id="submit" name="submit" class="submit_btn float_l" />
					
                </form>
            </div>
        </section>
    </div>